<%@ page language="java" pageEncoding="utf-8"%>
<%@taglib uri="estateTag" prefix="estateTag" %>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>

		<title>修改特价商品</title>
		<meta http-equiv="pragma" content="no-cache">
		<meta http-equiv="cache-control" content="no-cache">
		<meta http-equiv="expires" content="0">
		<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
		<meta http-equiv="description" content="This is my page">
		<link rel="stylesheet" href="../resource/css/global.css" type="text/css"></link>
	    <link rel="stylesheet" type="text/css" href="../resource/css/easyui/default/easyui.css"></link>
	    <link rel="stylesheet" href="../resource/css/whole.css" type="text/css"></link>
		<link rel="stylesheet" href="../resource/css/memberCenter/infowithoutmenu.css" type="text/css"></link>
		
		<script type="text/javascript" src="../resource/js/My97DatePicker/WdatePicker.js"></script>
		<script type="text/javascript" src="../resource/js/jquery-1.4.2.js"></script>
		<script type="text/javascript" src="../resource/js/easyui/jquery.easyui.min.js"></script>
		<script type="text/javascript" src="modifyGoods.js"></script>
			<link rel="stylesheet" href="../resource/js/kindeditor-4.1/themes/default/default.css" />
	<link rel="stylesheet" href="../resource/js/kindeditor-4.1/plugins/code/prettify.css" />
	<script charset="utf-8" src="../resource/js/kindeditor-4.1/kindeditor-min.js"></script>
	<script charset="utf-8" src="../resource/js/kindeditor-4.1/lang/zh_CN.js"></script>
	<script charset="utf-8" src="../resource/js/kindeditor-4.1/plugins/code/prettify.js"></script>
	</head>

	<body><estateTag:security></estateTag:security>
		<center><jsp:include page="../index/top.jsp"></jsp:include></center>
      <div style="width: 100%;margin-top: 10px;" align="center">
      <input id="menuCls" type="hidden" value="331">
			<table width="100%" class="layoutTab">
				<tr>
				<c:if test="${userinfo.type==2}">
				<td width="20%" align="left" valign="top"><jsp:include page="../menu.jsp"></jsp:include></td> 
				</c:if>
					<td valign="top">
					<form name="form" method="post"
										action="../goods/goods_addGoods.shtml"
										onsubmit="return checkmodify()" enctype="multipart/form-data">
					
					 <c:if test="${userinfo.type==1}">
					  <div class="position" align="left">
					</c:if>
					<c:if test="${userinfo.type==2}">
					  <div class="position2" align="left">
					</c:if>
					 <label>您所在的位置：</label>限时抢购管理模块&nbsp;&nbsp;--&gt;&gt;&nbsp;&nbsp;抢购产品设置&nbsp;&nbsp;--&gt;&gt;&nbsp;&nbsp;限时抢购商品维护</div>
					<br/>
					
					<c:if test="${userinfo.type==1||userinfo.type==0}">
					 <div class="info_top"></div> 
					 <div class="info_mid">
					</c:if>
					<c:if test="${userinfo.type==2}">
					<div class="info_top2"></div>
					<div class="info_mid2">
					</c:if>
					<center>
										<table width="960px" border="0" cellpadding="1" cellspacing="1" id="userinfo">
											<tr>
												<th  align="center" colspan="2">
													<b><c:if test="${goods.id == null}">新增</c:if><c:if test="${goods.id != null}">修改</c:if>商品信息 （<font color="red">*</font> 为必填项）</b>
												</th >
											</tr>

											<tr>
												<td align="right" width="15%">
														<font color="red">*</font>商品名称:
 												</td>
												<td align="left">
														<input id="name" type="text" name="goods.name" size="80" maxlength="50"
															value="${goods.name}" />
															<input type="hidden" value="${id}" name="id"/>
												</td>
											</tr>
											<tr>
												<td width="15%" align="right"><font color="red">*</font>产品类别:
												</td>
												<td align="left">
													<select name="bigCategory" onchange="bigCategoryChange()" id="bigCategory">
													<option value="">请选择</option>
														<s:iterator value="#pList" var="pdata" >
															<option value="<s:property value="#pdata.id"/>" 
															<s:if test='%{#pdata.id == #pid}'>
															selected="selected"
															</s:if>
															><s:property value="#pdata.name"/></option>
														</s:iterator>
													</select>
												</td>
											</tr>
											<tr>
												<td width="15%" align="right"><font color="red">*</font>子类别:</td>
												<td align="left" id="smallCategory">
													<select id="categoryId" name="categoryId" onchange="smallCategoryChange();">
													<option value="">请选择</option>
														<s:iterator value="#cList" var="cdata">
															<option value="<s:property value="#cdata.id"/>" 
															<s:if test='%{#cdata.id == #cid}'>
															selected="selected"
															</s:if>
															><s:property value="#cdata.name"/></option>
														</s:iterator>
													</select>
												</td>
											</tr>
											<tr>
												<td width="15%" align="right">选择符合的产品种类:</td>
												<td align="left" id="goodsType">
												
												<select id="typeId" name="typeId" onchange="threechange();">
													<option value="">请选择</option>
														<s:iterator value="#typeList" var="gdata">
															<option value="<s:property value="#gdata.id"/>" 
															<s:if test='%{#gdata.id == #tid}'>
															selected="selected"
															</s:if>
															><s:property value="#gdata.name"/></option>
														</s:iterator>
													</select>
												
												
												</td>
											</tr>
											<tr>
												<td width="15%" align="right"><font color="red">*</font>选择符合的产品:</td>
												<td align="left" id="goods">
												
												<select id="brandId" name="brandId">
													<option value="">请选择</option>
														<s:iterator value="#btList" var="gdata">
															<option value="<s:property value="#gdata.id"/>" 
															<s:if test='%{#gdata.id == #bid}'>
															selected="selected"
															</s:if>
															><s:property value="#gdata.name"/></option>
														</s:iterator>
													</select>
												
												
												</td>
											</tr>
											<tr>
												<td align="right">
														<font color="red">*</font>原价:
												</td>
												<td align="left">
														<input type="text" id="price" name="goods.price" size="25" maxlength="5"onkeyup="isNum(this)"
															value="${goods.price}" /> 
												</td>
											</tr>
											<tr>
												<td align="right">
														<font color="red">*</font>抢购价:
												</td>
												<td align="left">
														<input type="text" name="goods.upprice" id="upprice" size="25" maxlength="5"onkeyup="isNum(this)"
															value="${goods.upprice}" /> 
												</td>
											</tr>
											<tr>
												<td align="right">
														单位:
												</td>
												<td align="left">
														<input type="text" id="units" name="goods.units" size="25" maxlength="8"
															value="${goods.units}" />
												</td>
											</tr>
											<tr>
												<td align="right">
														上限人数:
												</td>
												<td align="left">
														<input type="text" id="joinCount" name="goods.maxCount" size="25" maxlength="4"
															value="${goods.maxCount}" />
												</td>
											</tr>
											<tr>
												<td align="right">
														抢购结束时间:
												</td>
												<td align="left">
														<input type="text" name="goods.overTime" id="overTime"
																readonly="readonly" size="25"
																onFocus="WdatePicker({firstDayOfWeek:7,dateFmt:'yyyy-MM-dd HH:mm:ss'})"
																class="Wdate" size="20" value="${goods.overTimeString}"/>
												</td>
											</tr>
											<tr>
												<td>
													<div align="right" >
														商品图片:
													</div>
												</td>
												<c:if test="${goods.imgSrc != null && goods.imgSrc!=''}">
												<td align="left">
													<img src="<%=basePath%>${goods.imgSrc}" id="imgE" height="100" width="100"/>&nbsp;&nbsp;&nbsp;<span id="picbtn"><input type="button"  onclick="modifyPic('picbtn')" value="修改"/></span>
												     <div id="modifyPic"></div> <font color="red">建议图片大小宽300px,高240px</font> 
												</td>
												</c:if>
												<c:if test="${goods.imgSrc == null||goods.imgSrc==''}">
												<td align="left">
													<input type="file" name="imgcomp" id="img" size="69"/> <font color="red">建议图片大小宽300px,高240px</font> 
												</td>
												</c:if>
											</tr>
											<tr>
												<td>
													<div align="right" >
														产品详情图片:
													</div>
												</td>
												<c:if test="${goods.bigImg != null && goods.bigImg!=''}">
												<td align="left">
													<img src="<%=basePath%>${goods.bigImg}" id="imgE" height="135px" width="230px"/>&nbsp;&nbsp;&nbsp;<span id="picbtn1"><input type="button"  onclick="modifyPic1('picbtn1')" value="修改"/></span>
												     <div id="modifyPic1"></div> <font color="red">建议图片大小宽300px,高240px</font> 
												</td>
												</c:if>
												<c:if test="${goods.bigImg == null||goods.bigImg==''}">
												<td align="left">
													<input type="file" name="imgcomp1" id="img" size="69"/> <br/><font color="red">建议图片大小宽460px,高270px</font> 
												</td>
												</c:if>
											</tr>
											<tr>
												<td align="right">
														<font color="red">*</font>咨询电话:
												</td>
												<td align="left">
														<input type="text" name="goods.tel" id="tel"  maxlength="19"
															value="${goods.tel}">
												</td>
											</tr>
											<tr>
												<td align="right">
														产品简介:
												</td>
												<td align="left">
															<textarea style="width:700px;height:300px;word-wrap:break-word;" id="content2" name="goods.content">${goods.content}</textarea>
												</td>
											</tr>
											<tr>
												<td align="right">
														产品描述：
												</td>
												<td align="left" id="filter_ke">
												         <font color="red">提示上传的图片最大宽度不要超过640px</font>
														<textarea style="width:700px;height:300px;word-wrap:break-word;" id="content1" name="goods.goodsDesc">${goods.goodsDesc}</textarea>
												</td>
											</tr>
                                             <tr>
												<td align="right">
														抢购声明：
												</td>
												<td align="left" id="filter_ke">
														<textarea style="width:700px;height:300px;word-wrap:break-word;"  id="statement" name="goods.stateMent">${goods.stateMent}</textarea>
												</td>
											</tr>   
											<tr>
												<td colspan="2" align="center">
													<input type="hidden" name="goods.id" value="${goods.id == null ? 0 :goods.id}">
													<input type="submit" value="提交">
													<input type="button" value="返回" onclick="javascript:window.history.go(-1)">
												</td>
											</tr>
										</table>
									</center>	
										   </div>
								<c:if test="${userinfo.type==2}">
								<div class="info_bottom2">&nbsp;</div>
								</c:if>
									<c:if test="${userinfo.type==1||userinfo.type==0}">
								<div class="info_bottom">&nbsp;</div>
								</c:if>
									</form>
								</td>
							</tr>
						</table>
		</div>
						<div style="margin-top: 10px;">
		</div>    
		<center> <iframe src="../index/footer.html" width="970" height="120" frameborder="0" scrolling="no"></iframe> </center></body>
</html>
 <script>
			var editor;
        KindEditor.ready(function(K) {
		               editor = K.create('#content1', {
		               allowFileManager : true,
		               uploadJson : '../resource/js/kindeditor-4.1/upload_json.jsp',
				       fileManagerJson : '../resource/js/kindeditor-4.1/file_manager_json.jsp',
                       items : [
					 	           'preview','source', '|', 'undo', 'redo', '|',  'cut', 'copy', 'paste',
						        'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
						        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
						        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
						        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
						        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
						       'insertfile', 'table', 'hr', 'emoticons', 'map', 'pagebreak',
						        'link', 'unlink'
                  ]
                        
                });
        });
  
       var editor1;
        KindEditor.ready(function(K) {
		               editor1 = K.create('#content2', {
		               allowFileManager : true,
		               uploadJson : '../resource/js/kindeditor-4.1/upload_json.jsp',
				       fileManagerJson : '../resource/js/kindeditor-4.1/file_manager_json.jsp',
                       items : [
					 	           'preview','source', '|', 'undo', 'redo', '|',  'cut', 'copy', 'paste',
						        'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
						        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
						        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
						        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
						        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
						       'insertfile', 'table', 'hr', 'emoticons', 'map', 'pagebreak',
						        'link', 'unlink'
                  ]
                        
                });
        });
			
		      var editor2;
        KindEditor.ready(function(K) {
		               editor2 = K.create('#statement', {
		               allowFileManager : true,
		               uploadJson : '../resource/js/kindeditor-4.1/upload_json.jsp',
				       fileManagerJson : '../resource/js/kindeditor-4.1/file_manager_json.jsp',
                       items : [
					 	           'preview','source', '|', 'undo', 'redo', '|',  'cut', 'copy', 'paste',
						        'wordpaste', '|', 'justifyleft', 'justifycenter', 'justifyright',
						        'justifyfull', 'insertorderedlist', 'insertunorderedlist', 'indent', 'outdent', 'subscript',
						        'superscript', 'clearhtml', 'quickformat', 'selectall', '|', 'fullscreen', '/',
						        'formatblock', 'fontname', 'fontsize', '|', 'forecolor', 'hilitecolor', 'bold',
						        'italic', 'underline', 'strikethrough', 'lineheight', 'removeformat', '|', 'image',
						       'insertfile', 'table', 'hr', 'emoticons', 'map', 'pagebreak',
						        'link', 'unlink'
                  ]
                        
                });
        });	
			 function goback(){
	            history.back();
	          }
			
</script>